<?php
	require 'libraries/SampleEntryLib.php';
	require 'libraries/PaymentLib.php';
	require 'libraries/UserLibrary.php';
	session_start();
	
	isSessionSet("administrator", null, "index.php");
?>

<html>
	<head>
		<title>CASLIMS | Edit Samples</title>
		<link rel="stylesheet" type="text/css" href="scripts/page.css" />
		<script type = "text/javascript" src="scripts/samplelib.js"></script>
		<link href="tools/favicon.ico" rel="shortcut icon" type="image/x-icon" /> 
	<!--
		Information about a sample include: 
		sampling date, 
		who submitted the sample, 
		type of sample (water, food, feed, soil, plant, and others), 
		type of sample, 
		analysis required (see other worksheet), 
		date submitted, 
		who received the sample, 
		and remarks. 
	-->	
	</head>
	<body>
		<div id="header"></div>
		<div id="wrapper">
			<div id="pagetop">
				<div class="greeting">Hi, <?php echo $_SESSION["administrator"];?> | <a href="Logout.php">Log out</a> | <a href="AdministratorHomepage.php"> Home </a></div>
				<div class="homepage"><?php echo $_SESSION["administrator"];?></div>
			</div>
			<form name = "addSample" action = "ProcessEditSampleEntry.php" id = "main-form" method = "post">
				<div id="fieldname">
					<h2>SAMPLE DETAIL PAGE</h2>
				</div>		
				<table border="0" align="center" width="100%">
					<tr>
						<td>No. of Samples:</td>
						<td><?php echo countSamples($_SESSION['sample_key'],"casl","localhost","login","login","sample_entry");?>
						<input type="hidden" name="numberofsamples" value="<?php echo countSamples($_SESSION['sample_key'],"casl","localhost","login","login","sample_entry");?>" />
						</td>
						<td>Type of Sample</td>
						<td><input type="text" name="sample_type" maxlength="30"/></td>					
					</tr>
					<tr>
						<td>Sampling Date:</td>
						<td>							
							<input type="text" name="sampling_date_year" size="4" maxlength="4"/>-
							<input type="text" name="sampling_date_month" size="2" maxlength="2"/>-
							<input type="text" name="sampling_date_day" size="2" maxlength="2"/>
							(yyyy-mm-dd)
						</td>
						<td>Analyst Assigned:</td>
						<td><?php drawAnalystTable("casl","localhost","login","login");?></td>					
					</tr>
					<tr>
						<td>
							<input type="checkbox" name="forall" value="1"> Copy for all samples
						</td>
					</tr>
				</table>
				<table width="80%">
				<tr></tr>
				<tr>
					<td>CASL No.</td>
					<td>Category</td>
					<td>Analysis Required</td>
					<td>Sample Code</td>
					<td>Remarks</td>
				</tr>
								
				<?php drawEditSampleDetailTable($_SESSION['sample_key'],"casl","localhost","createanalysis","createanalysis","sample_entry");?>
				</table>
				<table>
				<tr>
					<td rowspan='4'>Payment<input type="hidden" name="payment" id="payment" value=" "/></td>
					<td>Cash:</td>
					<td><input type="button"  <?php echo notPaid($_SESSION['sample_key'],'casl','localhost','login','login','payment'); ?> name="cash" id = "cash" value="Cash Payment" onclick='return pay("cash");'/></td>
					<td></td>
				</tr>
				<tr>
					<td>Check:</td>
					<td><input type="button"  <?php echo notPaid($_SESSION['sample_key'],'casl','localhost','login','login','payment'); ?> name="check" id="check" value="Check Payment" onclick='return pay("check");'/></td>
				</tr>
				<tr>
					<td></td>
					<td>Check Number</td>
					<td><input type="text"  <?php echo notPaid($_SESSION['sample_key'],'casl','localhost','login','login','payment'); ?> name="check_number" id = "check_number"  maxlength="90"/></td>
				</tr>	
				<tr>	
					<td></td>
					<td>Bank</td>
					<td><input type="text" <?php echo notPaid($_SESSION['sample_key'],'casl','localhost','login','login','payment'); ?>  name="bank" id = "bank"  maxlength="90"/></td>
				</tr>
				<tr>
					<td></td>
					<td>Official Receipt Num:</td>
					<td><input type="text"  <?php echo notPaid($_SESSION['sample_key'],'casl','localhost','login','login','payment'); ?> name="official_receipt_num"  id="official_receipt_num" maxlength="90"/></td>
				</tr>
				</table>
				<div id="buttons">
						<input type="submit" name="submit" value="main"/>
						<input type="submit" name="submit" value="summary">
				</div>
			</form>
			<div id="footerwrap">
				<div id="footer"> 
					<div class="copyright">Copyright 2011.<a>CASL BIOTECH-UPLB.</a> All Rights Reserved.<br/> 
				Arianne Buse&ntilde;os | Darlene Joy Masong | Rick Jason Obrero | Jonathan Pandi | Jonathan Simbahan | Emmanuel Soriano 
					</div> 
	    	    </div>
			</div>			
		</div>			
	</body>
</html>